package router

import (
	"exam_go/controller"

	"github.com/gin-gonic/gin"
)

func InitRouter(r *gin.Engine) {
	// r.Use(middleware.Error)
	apiRouter := r.Group("/api")
	{
		userController := controller.UserController{}
		{
			apiRouter.POST("/user/login", userController.HandleLogin)
			apiRouter.GET("/user/logout", userController.HandleLogout)
			apiRouter.GET("/user/getmusicinfo", userController.HandleGetSongInfo)
			apiRouter.GET("/user/searchsongs", userController.HandleSearchSongs)
			apiRouter.GET("/user/getPerRecommend", userController.HandleGetRecommend)
			apiRouter.GET("/user/getHotRecommend", userController.HandleGetRecommendByLanguage)
			apiRouter.GET("/user/getHotArtist", userController.HandleGetHotArtists)
		}
	}
}
